package com.cnxdc.demo.validations;

import com.cnxdc.demo.annotations.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class StateValidation implements ConstraintValidator<State, String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if (s == null) return false;
        if (s.equals("已发布")||s.equals("草稿")) return true;
        return false;
    }
}
